﻿@using NewRen.Models;
@using NewRen.Models.ViewModel;
@model NewRen.Models.ViewModel.vProduct
@{
    Business business = ViewBag.Bussiness;
    ViewBag.Title = "商品管理-商品添加";
    Layout = "~/Views/Shared/_Layout_Business.cshtml";
}

<div class="ucenter-left account-left-border">
    <div class="ucneter-l-head cf">
        <div class="ulhead-headicon">
            @if (business.Picture == null)
            {
                <img src="/Images/userphoto.png" width="50" height="50"
                     alt=@business.BusinessName style="border-radius:50%;" />
            }
            else
            {
                <img src="/Business/ShowPicture/@business.ID" width="50"
                     alt=@business.BusinessName height="50" style="border-radius:50%;" />
            }

        </div>
        <div class="ulhead-info">
            <p class="ulhead-info-uname">@business.BusinessName</p>

            <div class="ulhead-info-tool">
                <a class="ulhead-icon icon-lock ucenter-mail " href="/Business/PwdEdit/@business.ID" title="修改密码">
                    <div class="ucenter-mail-tip">修改密码</div>
                </a>
                <a href="/User/Edit/@business.ID"
                   class="ulhead-icon icon-setting ucenter-mail" title="修改商户信息"></a>
            </div>
        </div>
    </div>
    <div class="ucenter-l-list">
        <ul class="ullist-ul">
            <li id="uclick">
                <a href="/Business/Show/@business.ID">商户中心</a>
            </li>
            <li id="uclick1">
                <a href="/Business/Edit/@business.ID">商户设置</a>
            </li>
            <li id="uclick2" class="active">
                <a href="/Business/ProductManager/@business.ID">商户商品</a>
            </li>
        </ul>
    </div>
</div>
<div class="ucenter-right cf">
    <div class="ucenter-right-head"></div>
    <div class="tabGroup">
        @using (Html.BeginForm("AddProduct", "Business", FormMethod.Post, new
        {
            onsubmit = "return ProductAddCheck();"
        }))
        {
            @Html.AntiForgeryToken()
            @Html.HiddenFor(model => model.BusinessID, new { @Value = @business.ID })
            <div class=" form-item">
                <div class="item-label">
                    <label>产品名称：</label>
                </div>
                <div class="item-span">
                    @Html.TextBoxFor(model => model.ProductName, new { @class = "txt sm" })
                </div>
            </div>
            <div class=" form-item">
                <div class="item-label">
                    <label>价格：</label>
                </div>
                <div class="item-span">
                    @Html.TextBoxFor(model => model.Price, new { @class = "txt sm" })
                </div>
            </div>
            <div class=" form-item">
                <div class="item-label">
                    <label>兑换积分：</label>
                </div>
                <div class="item-span">
                    @Html.TextBoxFor(model => model.Integration, new { @class = "txt sm" })
                </div>
            </div>
            <div class=" form-item">
                <div class="item-label">
                    <label>开始时间：</label>
                </div>
                <div class="item-span">
                    <input type="text" id="Begin" name="Begin" class="date txt sm" onclick="product_date()">
                </div>
            </div>
            <div class=" form-item">
                <div class="item-label">
                    <label>结束时间：</label>
                </div>
                <div class="item-span">
                    <input type="text" id="End" name="End" class="date txt sm" onclick="product_date()">
                </div>
            </div>
            <div class=" form-item">
                <div class="item-label">
                    <label>是否展示：</label>
                </div>
                <div class="item-span">
                    @Html.EditorFor(model => model.IsShow, new { @class = "chk" })
                </div>
            </div>
            <div class="form-item">
                <div class="item-label">
                    <label>产品描述：</label>
                </div>
                <div class="item-span">
                    <textarea class="resize-none" name="description" id="description"></textarea>
                </div>
            </div>
            <div class="form-item">
                <div class="item-span">
                    <input type="submit" value="保存" class="btn">
                    <span class="defInfo">@Html.ValidationSummary(true)</span>
                </div>
            </div>
        }
    </div>
</div>